﻿using Nop.Core;
using Nop.Core.Domain.Customers;
using Nop.Core.Domain.Orders;
using Nop.Core.Domain.Stores;
using System.Collections.Generic;

namespace Nop.Services.Stores
{
    /// <summary>
    /// Store service
    /// </summary>
    public partial interface IStoreService
    {
        /// <summary>
        /// Get shopping items per store
        /// </summary>
        /// <param name="shoppingCartItems">All shopping cart items</param>
        /// <returns>Orders per stores</returns>
        StoreOrder GetStoreShoppingCartItems(IList<ShoppingCartItem> shoppingCartItems);

        /// <summary>
        /// Deletes a store
        /// </summary>
        /// <param name="store">Store</param>
        void DeleteStore(Store store);

        /// <summary>
        /// Gets all stores
        /// </summary>
        /// <param name="showHidden">A value indicating whether to show hidden records</param>
        /// <param name="showReserved">Show system reserved stores</param>
        /// <param name="adminCustomerId">Admin customer Id</param>
        /// <returns>Store collection</returns>
        IList<Store> GetAllStores(bool showHidden = false, bool showReserved = false, int adminCustomerId = 0);

        /// <summary>
        /// Gets all stores
        /// </summary>
        /// <param name="pageIndex">Page index</param>
        /// <param name="pageSize">Page size</param>
        /// <param name="showHidden">A value indicating whether to show hidden records</param>
        /// <param name="showReserved">Show system reserved stores</param>
        /// <param name="customerId">Customer identifier</param>
        /// <returns>Stores</returns>
        IPagedList<Store> GetAllStores(int pageIndex, int pageSize, bool showHidden = false, bool showReserved = false, int customerId = 0);

        /// <summary>
        /// Gets featured stores
        /// </summary>
        /// <param name="categoryId">A value indicating category Id. Default = 0 for all categories</param>
        /// <param name="showHidden">A value indicating whether to show hidden records</param>
        /// <param name="showReserved">Show system reserved stores</param>
        /// <param name="recordsToReturn">Records to return. 0 will return all.</param>
        /// <returns>Store collection</returns>
        IList<Store> GetFeaturedStores(int categoryId = 0, bool showHidden = false, bool showReserved = false, int recordsToReturn = 0);

        IList<Store> GetFavoriteStores(Customer customer);
        void AddFavoriteStore(int storeId, Customer customer);
        void RemoveFavoriteStore(int storeId, Customer customer);

        /// <summary>
        /// Gets a store
        /// </summary>
        /// <param name="storeId">Store identifier</param>
        /// <returns>Store</returns>
        Store GetStoreById(int storeId);

        /// <summary>
        /// Inserts a store
        /// </summary>
        /// <param name="store">Store</param>
        void InsertStore(Store store);

        /// <summary>
        /// Updates the store
        /// </summary>
        /// <param name="store">Store</param>
        void UpdateStore(Store store);

        /// <summary>
        /// Update store review totals
        /// </summary>
        /// <param name="product">Store ID</param>
        void UpdateProductReviewTotals(int storeId);

        /// <summary>
        /// Gets if store exists
        /// </summary>
        /// <param name="storeId">Store ID</param>
        /// <param name="includingDeleted">Including deleted store</param>
        /// <returns></returns>
        bool Exists(int storeId, bool includingDeleted = false);

        /// <summary>
        /// Gets a store branch
        /// </summary>
        /// <param name="storeId">Store identifier</param>
        /// <param name="branchId">Branch identifier</param>
        /// <returns>Store</returns>
        Branch GetStoreBranchById(int storeId, int branchId);

        /// <summary>
        /// Gets a store branch
        /// </summary>
        /// <param name="branchId">branch id</param>
        /// <returns>Branch</returns>
        Branch GetBranchById(int branchId);

        /// <summary>
        /// update branch
        /// </summary>
        /// <param name="branch">branch</param>
        /// <returns></returns>
        void UpdateBranch(Branch branch);

        IEnumerable<Branch> GetStoreBranchByRegion(int storeId, int regionId);
    }
}
